import request from '@/utils/request'

/**
 * @description 列表
 * @param data
 * @returns
 */
export const getUserListApi: IGetUserListApi = function (params) {
  return request.get('htscrm/users/list', { params });
};

/**
 * @description 详情
 * @param data
 * @returns
 */
export const getUserDetailApi: IGetUserDetailApi = function (id) {
  return request.get(`htscrm/users/info/${id}`);
};

/**
 * @description 添加
 * @param data
 * @returns
 */
export const addUserApi: IAddUserApi = function (data) {
  return request.post('htscrm/users/add', data);
};

/**
 * @description 编辑
 * @param data
 * @returns
 */
export const updateUserApi: IUpdateUserApi = function (data) {
  return request.post(`htscrm/users/edit/${data.id}`, data);
};

/**
 * @description 删除
 * @param data
 * @returns
 */
export const deleteUserApi: IDeleteUserApi = function (id) {
  return request.post(`htscrm/users/del/${id}`);
};

/**
 * @description 获取用户等级
 * @param data
 * @returns
 */
export const getLevelListApi: IGetLevelListApi = function () {
  return request.get(`htscrm/users/level_list`);
};

/**
 * @description 获取用户轨迹
 * @param data
 * @returns
 */
export const getTravelListApi: IGetTravelListApi = function (data) {
  return request.get(`htscrm/users/travel/${data.id}`);
};
